import 'package:flutter/material.dart';

import './noveldetail_header.dart';
import './noveldetail_bottom_button.dart';
import './noveldetail_otherbook.dart';
import './noveldetail_author.dart';
import './noveldetail_desc.dart';

class NovelDetailPage extends StatefulWidget {
  final String? novelId;
  NovelDetailPage({Key? key, this.novelId}) : super(key: key);

  @override
  State<NovelDetailPage> createState() => _NovelDetailPageState();
}

class _NovelDetailPageState extends State<NovelDetailPage> {
  bool isSummaryUnfold = false;

  changeSummaryMaxLines() {
    setState(() {
      isSummaryUnfold = !isSummaryUnfold;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0,
        title: Text('我将埋葬众神'),
        actions: [IconButton(onPressed: () {}, icon: Icon(Icons.more))],
      ),
      body: Stack(
        children: [
          ListView(
            children: [
              NovelDetailHeader(),
              Container(
                height: 10,
                color: Color(0xfff5f5f5),
              ),
              NovelDetailDesc(
                  summary:
                      'fdfdcdcdgfbgnhjtreqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmkcmdkcmdvnjfvjfnvdscdckdmked89wd6ds2d1v5d154f5df3df23c2d6f599w8ww51sx2s1x2s15s4d8w4dw1dsc33c26sd6s5ds1d1c5dc1d5c1d5c1d5c15dssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccsssssssssssssssssss',
                  isUnfold: isSummaryUnfold,
                  onPressed: changeSummaryMaxLines),
              Container(
                height: 10,
                color: Color(0xfff5f5f5),
              ),
              NovelDetailAuthor(),
              Container(
                height: 10,
                color: Color(0xfff5f5f5),
              ),
              NovelDetailOtherBook(),
              Container(
                height: 60.0,
              )
            ],
          ),
          NovelDetailBottomButton(),
        ],
      ),
    );
  }
}
